control
Class Community

java.lang.Object
  extended by control.Community

public class Community
extends java.lang.Object

This class permits to create the Cartesian product of all community states and all final states of a set of available services


Field Summary
private  AvailableServices availableService
           
 
Constructor Summary
Community(AvailableServices as)
           
 
Method Summary
 java.util.Iterator<CState> getCommunityStates()
          returns an iterator on community states created on fly
 java.util.Iterator<CState> getFinalCommunityStates()
          returns on iterator on final community states created on fly
 CState getInitialStates()
          gets the initial community state
 Service getService(int index)
          gets the service in the specified position
 int getServicePosition(Service service)
          gets the position of a service in the set of available services
 boolean isFinalCommunityState(CState cs)
          checks if a state of the community is final
 int size()
          community size
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

availableService

private AvailableServices availableService
Constructor Detail

Community

public Community(AvailableServices as)
Method Detail

getService

public Service getService(int index)
gets the service in the specified position

Parameters:
index - - the position
Returns:
a service

getCommunityStates

public java.util.Iterator<CState> getCommunityStates()
returns an iterator on community states created on fly

Returns:
Iterator composed by an array of community state

getFinalCommunityStates

public java.util.Iterator<CState> getFinalCommunityStates()
returns on iterator on final community states created on fly

Returns:
Iterator on final community states

getInitialStates

public CState getInitialStates()
gets the initial community state

Returns:
CState

getServicePosition

public int getServicePosition(Service service)
gets the position of a service in the set of available services

Parameters:
service - - the service we want to find
Returns:
an integer

isFinalCommunityState

public boolean isFinalCommunityState(CState cs)
checks if a state of the community is final

Parameters:
cs - - the community's state to check
Returns:
boolean true if cs is final, false otherwise

size

public int size()
community size

Returns:
int

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object